<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>添加品牌</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        .container {
            margin-top: 20px;
        }
        .form-container {
            max-width: 600px;
            margin: 0 auto;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="form-container">
            <div class="row">
                <div class="col-12">
                    <h2 class="mb-4">添加品牌</h2>
                    
                    <form th:action="@{/admin/brand/add}" th:object="${brand}" method="post">
                        <div class="mb-3">
                            <label for="name" class="form-label">品牌名称 <span class="text-danger">*</span></label>
                            <input type="text" class="form-control" id="name" th:field="*{name}" required>
                        </div>
                        
                        <div class="mb-3">
                            <label for="image" class="form-label">品牌图片</label>
                            <input type="text" class="form-control" id="image" th:field="*{image}" placeholder="请输入图片URL或文件名">
                            <div class="form-text">可选字段，留空则无图片</div>
                        </div>
                        
                        <div class="mb-4">
                            <label for="firstChar" class="form-label">首字母</label>
                            <input type="text" class="form-control" id="firstChar" th:field="*{firstChar}" maxlength="1" placeholder="如果不填写，系统将自动生成">
                            <div class="form-text">可选字段，系统会根据品牌名称自动生成首字母</div>
                        </div>
                        
                        <div class="d-grid gap-2 d-md-flex justify-content-md-end">
                            <a href="/admin/brand/list" class="btn btn-secondary me-md-2">取消</a>
                            <button type="submit" class="btn btn-primary">保存</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>